from django.shortcuts import render
from news.models import News

# Create your views here.


def news_list(request):
    new_list = News.objects.all()
    return render(request, 'list.html', {'new_list': new_list})


def detail(request, id):
    try:
        new = News.objects.get(pk=id)
        return render(request, 'detail.html', {'new': new})
    except:
        return render(request, '404.html')
